<!DOCTYPE html>
<html>

<head>
  <script type="text/javascript">
    document.addEventListener('click', function () {
      var ws = new WebSocket("ws://127.0.0.1:8080/terminal");

      ws.onopen = function () {
        ws.send("Hello, world");
      };

      ws.onmessage = function (evt) {
        alert(evt.data);
      };
    });
  </script>
</head>

</html>